<template>
	<view class="">
		<view class="nav-back">
			<top-heigth :backTitle="backTitle"></top-heigth>
		</view>	
		
		<view class="content-box home-index">
			<view class="content-box mine-font" v-if="list">
				<view>
					<view class="list border-b">
						<view class="list-l">平台电话</view>
						<view class="list-r" @click="callPhone(list.platformPhone.configValue)">
							<view class="list-r-font">{{list.platformPhone.configValue}}</view> <!--   callPhone(businessList.shopTel)"-->
							<image class="go" src="/static/image/call.png"></image>
						</view>
					</view>
					<view class="list">
						<view class="list-l">平台邮箱</view>
						<view class="list-r">
							<view class="list-r-font">{{list.platformEmail.configValue}}</view>
						</view>
					</view>
				</view>
			</view>
		</view>
		
	</view>
</template>

<script>
	import TopHeigth from '@/components/TopHeigth.vue'
	
	export default {
		data() {
			return {
				backTitle:"联系我们",
				userInfo: uni.getStorageSync('userInfo'),
				list: null,
				isShowMsg: false,
			}
		},
		components: { TopHeigth },
		onLoad() {
			this.getList()
		},
		methods: {
			// callPhone(phoneNumber) {
				// let system = uni.getSystemInfoSync(); // 获取系统信息
				// if (system.platform === 'android') { // 判断平台
				// 	this.isShowMsg = true; //弹出授权说明
				// }
			//   uni.makePhoneCall({
			//   	phoneNumber: phoneNumber
			//   });
			// },
			callPhone(phoneNumber) {
				// 获取app的权限状态数据
				let MainActivity = plus.android.runtimeMainActivity();
				let PermissionCheck = MainActivity.checkSelfPermission('android.permission.CALL_PHONE')
				if(PermissionCheck != 0){
					uni.showModal({
							title: '提示',
							content: '为了实现拨打电话功能，需要访问您的拨打电话和管理通话权限，您如果拒绝将无法使用该功能',
							// showCancel: false, // 不显示取消按钮
							success(res) {
								if (res.confirm) {
									uni.makePhoneCall({
										phoneNumber: phoneNumber
									});
								}
							}
						});
					}else{
						uni.makePhoneCall({
							phoneNumber: phoneNumber
						});
					}
			},
			getList(){
				 uni.$u.http.post('/api/shop/v1_0/tAppUserRCA/turnTAppUserInfo',{
					 
				}).then((res) => {
					this.list = res.data
				}) 
			},
			msgClick(){
				this.isShowMsg = false;
			},
		}
	}
</script>

<style lang="scss" scoped>
	@mixin flex($direction: row) {
		/* #ifndef APP-NVUE */
		display: flex;
		/* #endif */
		flex-direction: $direction;
	}
	.uv-nav-slot {
		@include flex;
		align-items: center;
		justify-content: space-between;
		border-width: 0.5px;
		border-radius: 100px;
		border-color: #dadbde;
		padding: 3px 7px;
		opacity: 0.8;
	}
	
	.mine-font{
		background: #fff;
		border-radius: 16rpx;
		
		font-size: 28rpx;
		color: #02091A;
		margin-top: 24rpx;
		.list{
			@include flex;
			align-items: center;
			justify-content:space-between;
			padding:28rpx 0;
			.go{
				width: 40rpx;
				height: 40rpx;
			}
			.list-l{
				@include flex;
				align-items: center;
				justify-content:flex-start;
			}
			.list-r{
				@include flex;
				align-items: center;
				justify-content:flex-end;
				.list-r-font{
					margin-right: 16rpx;
				}
			}
		}
	}
</style>
